PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

GetIconRefFromFile

Provides an IconRef for a file, folder or volume.

pascal OSErr GetIconRefFromFile (
                     FSSpec*theFile,
                     IconRef*iconRef,
                     SInt16*theLabel);

theFile
A pointer to a structure of type FSSpec specifying the file, folder or volume for the IconRef . For more information on the FSSpec structure, see Inside Macintosh: Files.

iconRef
A pointer to a value of type IconRef . On return, this value contains a reference to the desired icon data.

theLabel
A pointer to a value of type SInt16 . On return, this value specifies the file or folder's label.

function result
A result code. See Icon Services Result Codes for a description of possible return values.
DISCUSSION
Use this function if you have no information about the file object passed in the theFile parameter. If you have already called the File System Manager function PBGetCatInfo , you can use the function GetIconRefFromFolder if the object is a folder without custom icons or the function GetIconRef if the object is a file without custom icons. For more information on the PBGetCatInfo function, see Inside Macintosh: Files. The GetIconRefFromFile function increments the reference count of the IconRef .

Note

Remember to call the function ReleaseIconRef when you're done with an IconRef .


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)